﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ReportService.Models.ViewModels;

namespace ReportService.Models
{
    public class ReportModel
    {
        public VMStoreReport StoreReport { get; set; }
        public VMSummaryReport SummaryReport { get; set; }

        public IEnumerable<PL_TOU_TimeOfUse> ListTOU { get; set; }
        public IEnumerable<GetListTimeOfUseResult> PriceBoard { get; set; }
        public IEnumerable<GetStoresByNameResult> ListAllStores { get; set; }
        public IEnumerable<GetDevicesResult> ListAllDevices { get; set; }

        public IEnumerable<SelectListItem> ListReportYears { get; set; }

        public string CurrentSelectTab { get; set; }

        public string ReportSinceYear
        {
            get
            {
                if (ConfigurationManager.AppSettings.AllKeys.Contains("reportSinceYear"))
                {
                    return ConfigurationManager.AppSettings["reportSinceYear"];
                }
                else
                {
                    return "2000";
                }
            }
        }

        public ReportModel()
        {
            StoreReport = new VMStoreReport();
            SummaryReport = new VMSummaryReport();
            CurrentSelectTab = "PriceBoard";
        }
    }
}